﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Experimental.Director;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class PlayerCharacter : Character, IWeaponHitHandler
{
    [CompilerGenerated]
    private static OnValueChangedEvent<Suit> <>f__am$cacheB;
    [CompilerGenerated]
    private static Predicate<AnimationClip> <>f__am$cacheC;
    public static List<PlayerCharacter> all = new List<PlayerCharacter>();
    private Transform camFollowPoint;
    public bool inputDisabled;
    private Npc interactingNpc;
    private static int kCmdCmdCallInteractingNpcFunction;
    private static int kCmdCmdCallInteractingNpcFunctionNoParameter;
    private static int kCmdCmdSetInteractingNpcId;
    private static int kCmdCmdWeaponHit = -1102598577;
    private const string key_suitAssetName = "Player.suitAssetName";
    private static int kTargetRpcTargetApplyImpact;
    private static HashSet<string> serverFunctionFullNames = new HashSet<string>();
    [SyncVar(hook="OnSyncInteractingNpcIdUpdate")]
    private NetworkInstanceId syncInteractingNpcId;
    [SyncVar]
    internal NetworkInstanceId syncPlayerId;

    static PlayerCharacter()
    {
        NetworkBehaviour.RegisterCommandDelegate(typeof(PlayerCharacter), kCmdCmdWeaponHit, new NetworkBehaviour.CmdDelegate(PlayerCharacter.InvokeCmdCmdWeaponHit));
        kCmdCmdSetInteractingNpcId = 0x7ebbb64a;
        NetworkBehaviour.RegisterCommandDelegate(typeof(PlayerCharacter), kCmdCmdSetInteractingNpcId, new NetworkBehaviour.CmdDelegate(PlayerCharacter.InvokeCmdCmdSetInteractingNpcId));
        kCmdCmdCallInteractingNpcFunction = -1117220653;
        NetworkBehaviour.RegisterCommandDelegate(typeof(PlayerCharacter), kCmdCmdCallInteractingNpcFunction, new NetworkBehaviour.CmdDelegate(PlayerCharacter.InvokeCmdCmdCallInteractingNpcFunction));
        kCmdCmdCallInteractingNpcFunctionNoParameter = -880798699;
        NetworkBehaviour.RegisterCommandDelegate(typeof(PlayerCharacter), kCmdCmdCallInteractingNpcFunctionNoParameter, new NetworkBehaviour.CmdDelegate(PlayerCharacter.InvokeCmdCmdCallInteractingNpcFunctionNoParameter));
        kTargetRpcTargetApplyImpact = 0x34d4290b;
        NetworkBehaviour.RegisterRpcDelegate(typeof(PlayerCharacter), kTargetRpcTargetApplyImpact, new NetworkBehaviour.CmdDelegate(PlayerCharacter.InvokeRpcTargetApplyImpact));
        NetworkCRC.RegisterBehaviour("PlayerCharacter", 0);
    }

    protected override void Awake()
    {
        base.tag = GameTags.Player;
        base.Awake();
        all.Add(this);
    }

    public void CallCmdCallInteractingNpcFunction(string functionName, string parameterJson, string parameterTypeName)
    {
        if (!NetworkClient.active)
        {
            Debug.LogError("Command function CmdCallInteractingNpcFunction called on server.");
        }
        else if (base.isServer)
        {
            this.CmdCallInteractingNpcFunction(functionName, parameterJson, parameterTypeName);
        }
        else
        {
            NetworkWriter writer = new NetworkWriter();
            writer.Write((short) 0);
            writer.Write((short) ((ushort) 5));
            writer.WritePackedUInt32((uint) kCmdCmdCallInteractingNpcFunction);
            writer.Write(base.GetComponent<NetworkIdentity>().netId);
            writer.Write(functionName);
            writer.Write(parameterJson);
            writer.Write(parameterTypeName);
            base.SendCommandInternal(writer, 0, "CmdCallInteractingNpcFunction");
        }
    }

    public void CallCmdCallInteractingNpcFunctionNoParameter(string functionName)
    {
        if (!NetworkClient.active)
        {
            Debug.LogError("Command function CmdCallInteractingNpcFunctionNoParameter called on server.");
        }
        else if (base.isServer)
        {
            this.CmdCallInteractingNpcFunctionNoParameter(functionName);
        }
        else
        {
            NetworkWriter writer = new NetworkWriter();
            writer.Write((short) 0);
            writer.Write((short) ((ushort) 5));
            writer.WritePackedUInt32((uint) kCmdCmdCallInteractingNpcFunctionNoParameter);
            writer.Write(base.GetComponent<NetworkIdentity>().netId);
            writer.Write(functionName);
            base.SendCommandInternal(writer, 0, "CmdCallInteractingNpcFunctionNoParameter");
        }
    }

    public void CallCmdSetInteractingNpcId(NetworkInstanceId npcId)
    {
        if (!NetworkClient.active)
        {
            Debug.LogError("Command function CmdSetInteractingNpcId called on server.");
        }
        else if (base.isServer)
        {
            this.CmdSetInteractingNpcId(npcId);
        }
        else
        {
            NetworkWriter writer = new NetworkWriter();
            writer.Write((short) 0);
            writer.Write((short) ((ushort) 5));
            writer.WritePackedUInt32((uint) kCmdCmdSetInteractingNpcId);
            writer.Write(base.GetComponent<NetworkIdentity>().netId);
            writer.Write(npcId);
            base.SendCommandInternal(writer, 0, "CmdSetInteractingNpcId");
        }
    }

    public void CallCmdWeaponHit(NetworkInstanceId targetId)
    {
        if (!NetworkClient.active)
        {
            Debug.LogError("Command function CmdWeaponHit called on server.");
        }
        else if (base.isServer)
        {
            this.CmdWeaponHit(targetId);
        }
        else
        {
            NetworkWriter writer = new NetworkWriter();
            writer.Write((short) 0);
            writer.Write((short) ((ushort) 5));
            writer.WritePackedUInt32((uint) kCmdCmdWeaponHit);
            writer.Write(base.GetComponent<NetworkIdentity>().netId);
            writer.Write(targetId);
            base.SendCommandInternal(writer, 0, "CmdWeaponHit");
        }
    }

    public void CallServerNpcFunction(Npc npc, string functionName, object parameter)
    {
        if (this.interactingNpc == npc)
        {
            if (parameter != null)
            {
                string parameterJson = NetworkUtility.SerializeParamater(parameter);
                this.CallCmdCallInteractingNpcFunction(functionName, parameterJson, parameter.GetType().FullName);
            }
            else
            {
                this.CallCmdCallInteractingNpcFunctionNoParameter(functionName);
            }
        }
    }

    public void CallTargetApplyImpact(NetworkConnection conn, NetworkInstanceId targetId)
    {
        if (!NetworkServer.active)
        {
            Debug.LogError("TargetRPC Function TargetApplyImpact called on client.");
        }
        else
        {
            NetworkWriter writer = new NetworkWriter();
            writer.Write((short) 0);
            writer.Write((short) ((ushort) 2));
            writer.WritePackedUInt32((uint) kTargetRpcTargetApplyImpact);
            writer.Write(base.GetComponent<NetworkIdentity>().netId);
            writer.Write(targetId);
            this.SendTargetRPCInternal(conn, writer, 0, "TargetApplyImpact");
        }
    }

    private bool CheckServerFunction(System.Type type, string methodName)
    {
        string item = type.FullName + "." + methodName;
        if (serverFunctionFullNames.Contains(item))
        {
            return true;
        }
        MethodInfo instanceMethod = type.GetInstanceMethod(methodName);
        if (instanceMethod == null)
        {
            return false;
        }
        ServerFunctionAttribute customAttribute = instanceMethod.GetCustomAttribute<ServerFunctionAttribute>(true);
        if (customAttribute != null)
        {
            serverFunctionFullNames.Add(item);
        }
        return (customAttribute != null);
    }

    [Command]
    private void CmdCallInteractingNpcFunction(string functionName, string parameterJson, string parameterTypeName)
    {
        if (this.interactingNpc != null)
        {
            System.Type type = this.interactingNpc.GetType();
            if (!this.CheckServerFunction(type, functionName) && !this.CheckServerFunction(typeof(Npc), functionName))
            {
                object[] args = new object[] { type, functionName };
                Debug.LogFormat("Client trying to call a server function '{0}.{1}', but it does not exist.", args);
            }
            else
            {
                object obj2 = NetworkUtility.DeseralizeParamater(parameterJson, parameterTypeName);
                this.interactingNpc.SendMessage(functionName, obj2, SendMessageOptions.DontRequireReceiver);
            }
        }
    }

    [Command]
    private void CmdCallInteractingNpcFunctionNoParameter(string functionName)
    {
        if (this.interactingNpc != null)
        {
            this.interactingNpc.SendMessage(functionName, SendMessageOptions.DontRequireReceiver);
        }
    }

    [Command]
    private void CmdSetInteractingNpcId(NetworkInstanceId npcId)
    {
        Npc component = npcId.GetComponent<Npc>();
        if ((!npcId.IsValid() || (component == null)) || ((component.target == null) || (component.target == this)))
        {
            this.NetworksyncInteractingNpcId = npcId;
        }
    }

    [Command]
    private void CmdWeaponHit(NetworkInstanceId targetId)
    {
        if (base.weapon != null)
        {
            Character component = targetId.GetComponent<Character>();
            if (component != null)
            {
                base.weapon.ApplyDamage(this, component);
                if (component is PlayerCharacter)
                {
                    this.CallTargetApplyImpact(component.connectionToClient, component.netId);
                }
                else
                {
                    Vector3 vector = component.position - base.position;
                    base.weapon.ApplyImpact(component, -vector);
                }
            }
        }
    }

    private void EndInteractNpc(Npc npc)
    {
        if (this.interactingNpc != null)
        {
            this.CallCmdSetInteractingNpcId(NetworkInstanceId.Invalid);
            this.interactingNpc = null;
        }
    }

    private string GetItemDisplayName(string assetName)
    {
        Item item = AssetManager.GetItem(assetName);
        return ((item == null) ? assetName : item.displayName);
    }

    private string GetPrefsSuitName()
    {
        string assetName = PlayerPrefs.GetString("Player.suitAssetName");
        if (!AssetManager.HasAsset(assetName))
        {
            assetName = AssetManager.GetAllSuitAssets().First<Asset>().name;
        }
        return assetName;
    }

    private void InitHud()
    {
        <InitHud>c__AnonStorey62 storey = new <InitHud>c__AnonStorey62 {
            <>f__this = this
        };
        if (this.uiHud == null)
        {
            this.uiHud = GameResources.UIHUD.Clone();
            this.InitHudBar("Hp", new Func<float>(storey.<>m__C5), new Func<float>(storey.<>m__C6));
            this.InitHudBar("Energy", new Func<float>(storey.<>m__C7), new Func<float>(storey.<>m__C8));
            storey.consumableText = this.uiHud.FindChild<Text>("Consumable/Text");
            this.StartUpdate(new Action(storey.<>m__C9));
        }
    }

    private void InitHudBar(string barName, Func<float> getCurValue, Func<float> getMaxValue)
    {
        <InitHudBar>c__AnonStorey63 storey = new <InitHudBar>c__AnonStorey63 {
            getCurValue = getCurValue,
            getMaxValue = getMaxValue,
            fill = this.uiHud.FindChild<Image>(barName + "/Fill"),
            text = this.uiHud.FindChild<Text>(barName + "/Text")
        };
        this.StartUpdate(new Action(storey.<>m__CA));
    }

    private void InteractNpc(Npc npc)
    {
        if (this.interactingNpc == null)
        {
            this.CallCmdSetInteractingNpcId(npc.netId);
            this.interactingNpc = npc;
        }
    }

    protected static void InvokeCmdCmdCallInteractingNpcFunction(NetworkBehaviour obj, NetworkReader reader)
    {
        if (!NetworkServer.active)
        {
            Debug.LogError("Command CmdCallInteractingNpcFunction called on client.");
        }
        else
        {
            ((PlayerCharacter) obj).CmdCallInteractingNpcFunction(reader.ReadString(), reader.ReadString(), reader.ReadString());
        }
    }

    protected static void InvokeCmdCmdCallInteractingNpcFunctionNoParameter(NetworkBehaviour obj, NetworkReader reader)
    {
        if (!NetworkServer.active)
        {
            Debug.LogError("Command CmdCallInteractingNpcFunctionNoParameter called on client.");
        }
        else
        {
            ((PlayerCharacter) obj).CmdCallInteractingNpcFunctionNoParameter(reader.ReadString());
        }
    }

    protected static void InvokeCmdCmdSetInteractingNpcId(NetworkBehaviour obj, NetworkReader reader)
    {
        if (!NetworkServer.active)
        {
            Debug.LogError("Command CmdSetInteractingNpcId called on client.");
        }
        else
        {
            ((PlayerCharacter) obj).CmdSetInteractingNpcId(reader.ReadNetworkId());
        }
    }

    protected static void InvokeCmdCmdWeaponHit(NetworkBehaviour obj, NetworkReader reader)
    {
        if (!NetworkServer.active)
        {
            Debug.LogError("Command CmdWeaponHit called on client.");
        }
        else
        {
            ((PlayerCharacter) obj).CmdWeaponHit(reader.ReadNetworkId());
        }
    }

    protected static void InvokeRpcTargetApplyImpact(NetworkBehaviour obj, NetworkReader reader)
    {
        if (!NetworkClient.active)
        {
            Debug.LogError("TargetRPC TargetApplyImpact called on server.");
        }
        else
        {
            ((PlayerCharacter) obj).TargetApplyImpact(ClientScene.readyConnection, reader.ReadNetworkId());
        }
    }

    bool IWeaponHitHandler.HandleWeaponHit(Weapon weapon, Character attacker, Character target, Vector3 hitPoint, Vector3 hitNormal)
    {
        if (base.isLocalPlayer && (target != null))
        {
            this.CallCmdWeaponHit(target.netId);
            weapon.ApplyImpact(target, hitNormal);
        }
        return true;
    }

    public override void OnDeserialize(NetworkReader reader, bool initialState)
    {
        base.OnDeserialize(reader, initialState);
        if (initialState)
        {
            this.syncPlayerId = reader.ReadNetworkId();
            this.syncInteractingNpcId = reader.ReadNetworkId();
        }
        else
        {
            int num = (int) reader.ReadPackedUInt32();
            if ((num & 1) != 0)
            {
                this.syncPlayerId = reader.ReadNetworkId();
            }
            if ((num & 2) != 0)
            {
                this.OnSyncInteractingNpcIdUpdate(reader.ReadNetworkId());
            }
        }
    }

    protected override void OnDestroy()
    {
        base.OnDestroy();
        if (this.uiHud != null)
        {
            UnityEngine.Object.Destroy(this.uiHud);
        }
        if (this.cam != null)
        {
            UnityEngine.Object.Destroy(this.cam.gameObject);
        }
        all.Remove(this);
        if (local == this)
        {
            local = null;
        }
    }

    public override bool OnSerialize(NetworkWriter writer, bool forceAll)
    {
        bool flag2 = base.OnSerialize(writer, forceAll);
        if (forceAll)
        {
            writer.Write(this.syncPlayerId);
            writer.Write(this.syncInteractingNpcId);
            return true;
        }
        bool flag = false;
        if ((base.syncVarDirtyBits & 1) != 0)
        {
            if (!flag)
            {
                writer.WritePackedUInt32(base.syncVarDirtyBits);
                flag = true;
            }
            writer.Write(this.syncPlayerId);
        }
        if ((base.syncVarDirtyBits & 2) != 0)
        {
            if (!flag)
            {
                writer.WritePackedUInt32(base.syncVarDirtyBits);
                flag = true;
            }
            writer.Write(this.syncInteractingNpcId);
        }
        if (!flag)
        {
            writer.WritePackedUInt32(base.syncVarDirtyBits);
        }
        return (flag | flag2);
    }

    public override void OnStartAuthority()
    {
        base.OnStartAuthority();
        this.cam = GameResources.PlayerCamera.CloneGameObject<PlayerCamera>();
        this.camFollowPoint = this.CreateChildGameObject("CameraFollowPoint").transform;
        this.camFollowPoint.localEulerAngles = new Vector3(45f, 45f, 0f);
        this.cam.target = this.camFollowPoint;
        this.cam.speed = 2f;
        this.cam.offset = new Vector3(0f, 1f, 0f);
        this.InitHud();
        GameResources.SeeThroughTrigger.CloneGameObjectAsChild<SeeThroughTrigger>(base.transform, true);
        base.inventory.CreateSuit(this.GetPrefsSuitName());
        if (<>f__am$cacheB == null)
        {
            <>f__am$cacheB = delegate (Suit curValue, Suit lastValue) {
                if (curValue != null)
                {
                    string assetName = curValue.GetAssetName();
                    PlayerPrefs.SetString("Player.suitAssetName", assetName);
                }
            };
        }
        base.inventory.onSuitChanged += <>f__am$cacheB;
        base.life.onDie += delegate {
            Animator original = base.GetComponentInChildren<Animator>();
            Animator animator2 = UnityEngine.Object.Instantiate(original, original.transform.position, original.transform.rotation) as Animator;
            if (<>f__am$cacheC == null)
            {
                <>f__am$cacheC = x => x.name == "Die";
            }
            animator2.Play((Playable) AnimationClipPlayable.Create(animator2.runtimeAnimatorController.animationClips.Find<AnimationClip>(<>f__am$cacheC)));
            base.inventory.DestroySuit();
        };
        base.life.onResurrect += delegate {
            base.inventory.CreateSuit(this.GetPrefsSuitName());
            this.StartWaitForEndOfFrame(() => this.PlayUseItemAnimation(null));
        };
        this.SetPosition(base.position);
        local = this;
    }

    public override void OnStartClient()
    {
        base.OnStartClient();
        this.player = this.syncPlayerId.GetComponent<Player>();
        this.player.character = this;
        base.name = this.player.name;
        this.PlayUseItemAnimation(null);
        this.OnSyncInteractingNpcIdUpdate(this.syncInteractingNpcId);
    }

    private void OnSyncInteractingNpcIdUpdate(NetworkInstanceId npcId)
    {
        Npc component = this.syncInteractingNpcId.GetComponent<Npc>();
        Npc npc2 = npcId.GetComponent<Npc>();
        if (npcId.IsValid())
        {
            this.StartWaitUntilNetworkInstanceSpawn<Npc>(npcId, v => v.Interact(this));
        }
        else if (component != null)
        {
            component.EndInteract(this);
        }
        this.NetworksyncInteractingNpcId = npcId;
        this.interactingNpc = npc2;
    }

    public void SetDontDestroyOnLoad(bool value)
    {
        if (this.cam != null)
        {
            this.SetDontDestroyOnLoad(this.cam.gameObject, value);
        }
        if (this.uiHud != null)
        {
            this.SetDontDestroyOnLoad(this.uiHud, value);
        }
        this.SetDontDestroyOnLoad(base.gameObject, value);
    }

    private void SetDontDestroyOnLoad(GameObject go, bool value)
    {
        if (value)
        {
            go.transform.SetParent(this.player.transform);
        }
        else
        {
            go.transform.SetParent(null);
            SceneManager.MoveGameObjectToScene(go, SceneManager.GetActiveScene());
        }
    }

    public void SetPosition(Vector3 position)
    {
        base.transform.position = position;
        if (this.cam != null)
        {
            this.cam.transform.position = position;
        }
        if (base.move != null)
        {
            base.move.StopMoving();
        }
    }

    [TargetRpc]
    private void TargetApplyImpact(NetworkConnection conn, NetworkInstanceId targetId)
    {
        if (base.weapon != null)
        {
            Character component = targetId.GetComponent<Character>();
            if (component != null)
            {
                Vector3 vector = component.position - base.position;
                base.weapon.ApplyImpact(component, -vector.normalized);
            }
        }
    }

    private void UNetVersion()
    {
    }

    private void Update()
    {
        if (this.inputDisabled)
        {
            base.move.direction = Vector3.zero;
        }
        else if (local == this)
        {
            Collider collider;
            bool flag = GUIUtility.hotControl > 0;
            Vector3 v = new Vector3(Input.GetAxisRaw("Horizontal"), 0f, Input.GetAxisRaw("Vertical"));
            Vector3 vector2 = v;
            if (this.cam != null)
            {
                Vector3 mousePosition = Input.mousePosition;
                if (Input.GetMouseButton(1))
                {
                    mousePosition = new Vector3((float) (Screen.width / 2), (float) Screen.height, 0f);
                    this.camFollowPoint.localEulerAngles += (Vector3) (((Vector3.up * Input.GetAxis("Mouse X")) * Time.deltaTime) * 12f);
                }
                Cursor.lockState = !Input.GetMouseButton(1) ? CursorLockMode.None : CursorLockMode.Locked;
                this.cam.transform.rotation = Quaternion.Lerp(this.cam.transform.rotation, this.camFollowPoint.localRotation, Time.deltaTime * 4f);
                vector2 = Matrix4x4.TRS(this.cam.transform.position, Quaternion.Euler(0f, this.cam.transform.eulerAngles.y, 0f), Vector3.one).MultiplyVector(v);
                mousePosition.x = Mathf.Clamp(mousePosition.x, 0f, (float) Screen.width);
                mousePosition.y = Mathf.Clamp(mousePosition.y, 0f, (float) Screen.height);
                Vector3 vector5 = this.cam.cam.GetWorldPositionOnPlaneXZ(mousePosition, 0f) - base.transform.position;
                base.look.direction = vector5;
                this.camFollowPoint.position = base.transform.position;
            }
            base.move.direction = vector2;
            IInteractable enteredTarget = base.interact.GetEnteredTarget(out collider);
            if (collider != null)
            {
                OutlineDrawer.Draw(collider.gameObject);
            }
            if ((this.interactingNpc != null) && (enteredTarget != this.interactingNpc))
            {
                this.EndInteractNpc(this.interactingNpc);
                this.interactingNpc = null;
            }
            if (Input.GetKeyDown(KeyCode.E))
            {
                Npc npc = enteredTarget as Npc;
                if (npc != null)
                {
                    this.InteractNpc(npc);
                }
                else
                {
                    base.interact.DoInteract();
                }
            }
            if (!base.isDied)
            {
                if (Input.GetMouseButton(0) && !flag)
                {
                    base.attack.DoAttack();
                }
                if (Input.GetKeyDown(KeyCode.Q))
                {
                    base.inventory.SwitchWeapon();
                }
                if (Input.GetKeyDown(KeyCode.G))
                {
                    base.inventory.DropWeapon();
                }
            }
        }
    }

    public PlayerCamera cam { get; private set; }

    private bool isDialoguing
    {
        get
        {
            return (this.interactingNpc != null);
        }
    }

    public static PlayerCharacter local
    {
        [CompilerGenerated]
        get
        {
            return <local>k__BackingField;
        }
        [CompilerGenerated]
        private set
        {
            <local>k__BackingField = value;
        }
    }

    public NetworkInstanceId NetworksyncInteractingNpcId
    {
        get
        {
            return this.syncInteractingNpcId;
        }
        [param: In]
        set
        {
            if (NetworkServer.localClientActive && !base.syncVarHookGuard)
            {
                base.syncVarHookGuard = true;
                this.OnSyncInteractingNpcIdUpdate(value);
                base.syncVarHookGuard = false;
            }
            base.SetSyncVar<NetworkInstanceId>(value, ref this.syncInteractingNpcId, 2);
        }
    }

    public NetworkInstanceId NetworksyncPlayerId
    {
        get
        {
            return this.syncPlayerId;
        }
        [param: In]
        set
        {
            base.SetSyncVar<NetworkInstanceId>(value, ref this.syncPlayerId, 1);
        }
    }

    public Player player { get; private set; }

    public int teamId
    {
        get
        {
            return this.player.teamId;
        }
    }

    public GameObject uiHud { get; private set; }

    [CompilerGenerated]
    private sealed class <InitHud>c__AnonStorey62
    {
        internal PlayerCharacter <>f__this;
        internal Text consumableText;

        internal float <>m__C5()
        {
            return this.<>f__this.life.hp;
        }

        internal float <>m__C6()
        {
            return this.<>f__this.life.maxHp;
        }

        internal float <>m__C7()
        {
            return this.<>f__this.energy;
        }

        internal float <>m__C8()
        {
            return this.<>f__this.maxEnergy;
        }

        internal void <>m__C9()
        {
            if ((Time.frameCount % 30) == 0)
            {
                this.consumableText.text = string.Join("\n", (from x in this.<>f__this.inventory.GetAllItems() select this.<>f__this.GetItemDisplayName(x.Key) + ((x.Value <= 1) ? string.Empty : (" x " + x.Value))).ToArray<string>());
            }
        }

        internal string <>m__CE(KeyValuePair<string, uint> x)
        {
            return (this.<>f__this.GetItemDisplayName(x.Key) + ((x.Value <= 1) ? string.Empty : (" x " + x.Value)));
        }
    }

    [CompilerGenerated]
    private sealed class <InitHudBar>c__AnonStorey63
    {
        internal Image fill;
        internal Func<float> getCurValue;
        internal Func<float> getMaxValue;
        internal Text text;

        internal void <>m__CA()
        {
            float num = this.getCurValue();
            float num2 = this.getMaxValue();
            if (num2 > 0f)
            {
                this.fill.fillAmount = num / num2;
                this.text.text = num + "/" + num2;
            }
            else
            {
                this.fill.fillAmount = 0f;
                this.text.text = string.Empty;
            }
        }
    }
}

